function SpatialPrint(sdm, outfile, sheet)
%% Rho/Direct/indirect/total
cnames = {'Lower01', 'Lower05','Mean','Upper95', 'Upper99'}; 
rnames = cellstr(sdm.rho_in.rnames);
rho_table = array2table(sdm.rho_out, ... 
                         'VariableNames',cnames, ...
                         'RowNames',rnames(2:end));

%cnames = {'Coefficient', 't_stat','p_value','Lower01', 'Upper99'}; 
cnames = cellstr(sdm.b_in.cnames)';
rnames = cellstr(sdm.b_in.rnames);
b_table = array2table(sdm.b_out, ... 
                         'VariableNames',cnames, ...
                         'RowNames',rnames(2:end));

%cnames = {'Coefficient', 't_stat','p_value','Lower01', 'Upper99'}; 
cnames = cellstr(sdm.direct_in.cnames)';
rnames = cellstr(sdm.direct_in.rnames);
direct_table = array2table(sdm.direct_out, ... 
                         'VariableNames',cnames, ...
                         'RowNames',rnames(2:end));

rnames = cellstr(sdm.indirect_in.rnames);
indirect_table = array2table(sdm.indirect_out, ... 
                         'VariableNames',cnames, ...
                         'RowNames',rnames(2:end));

rnames = cellstr(sdm.total_in.rnames);
total_table = array2table(sdm.total_out, ... 
                         'VariableNames',cnames, ...
                         'RowNames',rnames(2:end));

fprintf('                                       Rho Estimates\n') 
fprintf('                                       _____________\n\n') 
disp(rho_table)   

fprintf('                                       Direct Estimates\n') 
fprintf('                                       ________________\n\n') 
disp(direct_table)  

fprintf('                                       Indirect Estimates\n') 
fprintf('                                       __________________\n\n') 
disp(indirect_table)  

fprintf('                                       total Estimates\n') 
fprintf('                                       _______________\n\n') 
disp(total_table)  


%%
writetable(b_table          , outfile ,'WriteRowNames',true, 'Sheet', sheet, 'Range', 'A1');
writetable(direct_table     , outfile ,'WriteRowNames',true, 'Sheet', sheet, 'Range', 'H1');
writetable(indirect_table   , outfile ,'WriteRowNames',true, 'Sheet', sheet, 'Range', 'O1');
writetable(total_table      , outfile ,'WriteRowNames',true, 'Sheet', sheet, 'Range', 'V1');